<html>
<head>
  <title>Kudewe Reports</title>
    <!-- Ext includes -->
    <link rel="stylesheet" type="text/css" href="lib/ext-4.0.0/resources/css/ext-all.css" />
    <script type="text/javascript" src="lib/ext-4.0.0/bootstrap.js"></script>
	
	<style>
		#homeTab {
			padding: 20px;
			font-family: tahoma,arial,helvetica,sans-serif;
			font-size: 12px;
		}
		h1 {
			font-size: 14px;
		}
		#logo {
			float: left;
		}
		#messagePanel {
			margin-left: 200px;
		}
	</style>
	
	<!-- libs -->
	<script type="text/javascript" src="lib/ui/buildMenu.js"></script>
	
	<script type="text/javascript">
	Ext.require(['*']);

	Ext.onReady(function(){
	    Ext.QuickTips.init();

	 	// Get dash board definition and build it
		Ext.Ajax.request({
			url: 'metadata/menu.json' , 
			params: {},
			method: 'GET',
			success: function (result, request) { 
				var tabPanel = new Ext.TabPanel({
		            region: 'center', // a center region is ALWAYS required for border layout
		            deferredRender: false,
		            activeTab: 0,     // first tab initially active
		            items: [{
		                contentEl: 'homeTab',
		                title: 'Bienvenido',
		                closable: false,
		                autoScroll: true
		            }]
		        });

				var menu = buildMenu(Ext.decode(result.responseText), tabPanel);
		    	
		        var viewport = new Ext.Viewport({
		            layout: 'border',
		            items: [{
		                region: 'north',
		                height: 32,
		                layout: 'fit', // specify layout manager for items
		                items: [
							menu
		        		]
		            }, tabPanel]
		        });
				
			},
			failure: function ( result, request) { 
				Ext.MessageBox.alert('Failed', result.responseText); 
			} 
		});
	});
	</script>
</head>
<body>
    <div id="homeTab" class="x-hide-display">
       	<div id="logo">
	 		<a href="http://www.kudewe.com" target="_blank"><img src="img/logo.gif"></a>
	 	</div>
  		<div id="messagePanel">
	  		<h1>Bienvenido a Kudewe Reports</h1>
  			<p>Punto panor&aacute;mico de su organizaci&oacute;n</p>
  			<p><a href="http://www.kudewe.com" target="_blank">http://www.kudewe.com</a></p>
	    </div>
    </div>
    
</body>
</html>
